dt-uart: support /chosen/stdout-path property.
authorIan Campbell <ian.campbell@citrix.com>
Thu, 8 Jan 2015 11:53:56 +0000 (11:53 +0000)
committerIan Campbell <ian.campbell@citrix.com>
Mon, 12 Jan 2015 16:05:15 +0000 (16:05 +0000)
commitc69ec40e260d54f5e0915fd59c67330efb442437
tree5576620aa255c00becf678b3172b8526dc5ec4cd
parentf01af57300cb60ab0fd8487fb5bbbe97bee234f0
dt-uart: support /chosen/stdout-path property.

ePAPR v1.1 section 3.5 defines the /chosen/stdout-path property to
refer to the device to be used for boot console output, so if no
dtuart property is given try to use that instead. This will make Xen
find a suitable console by default on DT platforms which include this
property.

As it happens the dtuart option has the exact same syntax as
stdout-path, so we can just copy the value into that buffer if it is
empty. If the string is too large for the buffer we truncate and warn
but continue in the hopes that enough of the path survived (i.e. only
the options part was dropped) to get something out.

FWIW support for this was added to Linux in v3.19-rc1 (7914a7c5651a
"of: support passing console options with stdout-path") and a fairly
large number of the dts files shipped with Linux have already included
a stdout-path property for quite a while now.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Reviewed-by: Julien Grall <julien.grall@linaro.org>
xen/arch/arm/domain_build.c
xen/drivers/char/dt-uart.c